package com.gaojinqi.sys.modular.rbac.vo;

import com.gaojinqi.base.common.enums.StateEnum;
import com.gaojinqi.base.common.validation.custom.EnumValid;
import com.gaojinqi.base.common.validation.group.Default;
import com.gaojinqi.base.common.validation.group.Insert;
import com.gaojinqi.sys.common.enums.PermTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 权限新增修改参数
 *
 * @author gaojinqi
 * @version 1.0
 * @since 2020年05月20日
 */
@Data
public class PermSaveVo {

    @ApiModelProperty(value = "权限编码")
    @NotBlank(message = "请输入权限编码", groups = Insert.class)
    private String parentId;

    @ApiModelProperty(value = "权限编码", required = true)
    @NotBlank(message = "请输入权限编码", groups = Insert.class)
    private String permission;

    @ApiModelProperty(value = "权限名称", required = true)
    @NotBlank(message = "请输入权限名称", groups = Insert.class)
    private String permissionName;

    @ApiModelProperty(value = "请求路径")
    private String url;

    @ApiModelProperty(value = "请求方法")
    private String method;

    @ApiModelProperty(value = "类型", example = "0", required = true)
    @EnumValid(value = PermTypeEnum.class, groups = Default.class, message = "请选择正确的权限类型")
    @NotNull(message = "请选择权限类型")
    private Byte type;

    @ApiModelProperty(value = "启用状态 默认启动", example = "1", required = true)
    @EnumValid(value = StateEnum.class, groups = Default.class, message = "请选择正确的启用状态")
    @NotNull(message = "请选择启用状态", groups = Insert.class)
    private Byte state;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "排序 从小到大排序 默认0")
    private Integer sort;

}
